#ifndef BASE_PROCESSOR_H
#define BASE_PROCESSOR_H

#include <vector>

namespace Tvimeg
{
	class Entry;
	class File;

	class BaseProcessor
	{
	public:
		BaseProcessor(void);
		virtual ~BaseProcessor(void);

		void			Process(const Entry& entry) const;

	protected:
		virtual int		AddEntry(const Entry& entry) const = 0;
		virtual int		UpdateEntry(const Entry& entry) const = 0;

		virtual void	RemoveEntryFiles(const int entryId) const = 0;
		virtual void	AddEntryFile(const int fileId, const int entryId) const = 0;

	private:
		void			Add(const Entry& entry) const;
		void			Update(const Entry& entry) const;

		void			AddFile(const File& file, std::vector<int>& fileIds) const;
		void			UpdateFile(const File& file, std::vector<int>& fileIds) const;
	};
}

#endif // BASE_PROCESSOR_H
